Class PagerRenderer

Summary

Fully Qualified Name: CodeIgniter\Pager\PagerRenderer

Description

Class PagerRenderer

This class is passed to the view that describes the pagination, and is used to get the link information and provide utility methods needed to work with pagination.

Methods

Name Description Defined By
__construct() Constructor. PagerRenderer
getCurrent() Returns the URI of the current page. PagerRenderer
getFirst() Returns the URI of the first page. PagerRenderer
getLast() Returns the URI of the last page. PagerRenderer
getNext() Returns a URL to the "next" page. The next page is NOT, the page after the current page, but is the page that follows the "last" page. PagerRenderer
getNextPage() Returns a URL to the "next" page. PagerRenderer
getPrevious() Returns a URL to the "previous" page. The previous page is NOT the page before the current page, but is the page just before the "first" page. PagerRenderer
getPreviousPage() Returns a URL to the "previous" page. PagerRenderer
hasNext() Checks to see if there is a "next" page after our "last" page. PagerRenderer
hasNextPage() Checks to see if there is a "next" page after our "last" page. PagerRenderer
hasPrevious() Checks to see if there is a "previous" page before our "first" page. PagerRenderer
hasPreviousPage() Checks to see if there is a "previous" page before our "first" page. PagerRenderer
links() Returns an array of links that should be displayed. Each link is represented by another array containing of the URI the link should go to, the title (number) of the link, and a boolean value representing whether this link is active or not. PagerRenderer
setSurroundCount() Sets the total number of links that should appear on either side of the current page. Adjusts the first and last counts to reflect it. PagerRenderer

Method Details

__construct()

Constructor.

Parameter Name Type Description
$details array

Returns:

getCurrent()

Returns the URI of the current page.

Returns: string

getFirst()

Returns the URI of the first page.

Returns: string

getLast()

Returns the URI of the last page.

Returns: string

getNext()

Returns a URL to the "next" page. The next page is NOT, the page after the current page, but is the page that follows the "last" page.

You MUST call hasNext() first, or this value may be invalid.

Returns: string|null

getNextPage()

Returns a URL to the "next" page.

You MUST call hasNextPage() first, or this value may be invalid.

Returns: string|null

getPrevious()

Returns a URL to the "previous" page. The previous page is NOT the page before the current page, but is the page just before the "first" page.

You MUST call hasPrevious() first, or this value may be invalid.

Returns: string|null

getPreviousPage()

Returns a URL to the "previous" page.

You MUST call hasPreviousPage() first, or this value may be invalid.

Returns: string|null

hasNext()

Checks to see if there is a "next" page after our "last" page.

Returns: bool

hasNextPage()

Checks to see if there is a "next" page after our "last" page.

Returns: bool

hasPrevious()

Checks to see if there is a "previous" page before our "first" page.

Returns: bool

hasPreviousPage()

Checks to see if there is a "previous" page before our "first" page.

Returns: bool

links()

Returns an array of links that should be displayed. Each link is represented by another array containing of the URI the link should go to, the title (number) of the link, and a boolean value representing whether this link is active or not.

Returns: array

setSurroundCount()

Sets the total number of links that should appear on either side of the current page. Adjusts the first and last counts to reflect it.

Parameter Name Type Description
$count int|null

Returns: \PagerRenderer

Top